/*
 * $Id$
 *
 * Copyright (c) 2011 Ant�nio Godinho, All Rights Reserved.
 * (nunes.godinho@gmail.com)
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 *
 * Last changed on $Date$
 * Last changed by $Author$
 */
package pt.isec.gps.fastnote;

import java.awt.event.ActionEvent;
import java.io.IOException;

import javax.swing.JTabbedPane;
import javax.swing.JTextPane;
import javax.swing.text.BadLocationException;
import javax.swing.text.html.HTMLDocument;
import javax.swing.text.html.HTMLEditorKit;

/**
 * <Class description>
 * 
 * @author Antonio Godinho
 * @version $Revision$
 */
public class TextEffectsBullet implements TextEffects {

    /*
     * (non-Javadoc)
     * @see pt.isec.gps.fastnote.TextEffects#formatTextEffects(javax.swing.JTabbedPane,
     * javax.swing.text.html.HTMLEditorKit)
     */
    @Override
    public void formatTextEffects(JTabbedPane editor, HTMLEditorKit editorKit, ActionEvent action) {
        JTextPane pane = (JTextPane) editor.getSelectedComponent();
        HTMLDocument document = (HTMLDocument) pane.getDocument();
        try {
            TextEffectsUtils.insertHTML(document, pane.getSelectionStart(), "<ul><li></li></ul>", 0, 0, null);
        } catch (BadLocationException e) {
        } catch (IOException e) {
        }
    }
}
